
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)

project(intro LANGUAGES C)

include_directories(../common)

set(COMPILE_ALL OFF)

list(APPEND _sources
    ../common/error.c
    ../common/pathalloc.c
    ../common/prexit.c
    ../common/tellwait.c
    # 05_mutex1.c
    09_rwlock.c
    10_maketimeout.c
    11_condvar.c
)

if (COMPILE_ALL)
add_executable(threadid 01_threadid.c ${_sources})
add_executable(exitstatus 02_exitstatus.c ${_sources})
add_executable(badexit2 03_badexit2.c ${_sources})
add_executable(cleanup 04_cleanup.c ${_sources})
add_executable(timedlock 08_timedlock.c ${_sources})
else()
add_executable(barrier 12_barrier.c ${_sources})
endif()
